package com.bionic.banking.core.entity;

import java.io.Serializable;

public class User implements Serializable {

    private Integer userId;
    private String login;
    private String password;

    public User() {
    }

    public User(String login, String password) {
        this.login = login;
        this.password = password;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getLogin() {
        return login;
    }

    public void setLogin(String login) {
        this.login = login;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (userId != null ? userId.hashCode() : 0);

        final int multiplier = 23;
        if (hash == 0) {
            int code = 133;
            code = multiplier * code + login.hashCode();
            hash = code;
        }
        return hash;
    }

    @Override
    public boolean equals(Object object) {        
        if (!(object instanceof User)) {
            return false;
        }
        User other = (User) object;

        if (this.login.equals(other.login)) {
            return true;
        }

        return false;
    }

    @Override
    public String toString() {
        return login;
    }
}
